package com.itheima.util;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.stereotype.Controller;

@Controller
public class ElasticSearchUtils {
    //创建ElasticSearch客户端对象
    public RestHighLevelClient createClient(){
        RestHighLevelClient client = new RestHighLevelClient(
                 RestClient.builder(new HttpHost("192.168.100.130",9200,"http")));
        return client;
    }
}
